//
//  QLKEmptyCellTableViewCell.m
//  CloudsOutpatient
//
//  Created by czy on 15/6/28.
//  Copyright (c) 2015年 HC. All rights reserved.
//

#import "QLKEmptyCellTableViewCell.h"

@implementation QLKEmptyCellTableViewCell

#define kContentHegiht  177
#define kContentTop  100

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor =[UIColor colorWithHexString:@"ffffff"];
        if (!self.emptyDataBackgroundView) {
            _emptyDataBackgroundView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH,SCREEN_HEIGHT)];
            _emptyDataBackgroundView.backgroundColor = [UIColor clearColor];
            [self.contentView addSubview:_emptyDataBackgroundView];
            [_emptyDataBackgroundView addSubview:_logo];
            _logo = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 119, 142)];
            [_emptyDataBackgroundView addSubview:_logo];

            _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 15)];
            _titleLabel.textAlignment = NSTextAlignmentCenter;
            _titleLabel.textColor = [UIColor colorWithHexString:@"2f2f2f"];
            _titleLabel.font = [UIFont systemFontOfSize:15];
            [_emptyDataBackgroundView addSubview:_titleLabel];
            
            _shuaxinBt=[UIButton buttonWithType:UIButtonTypeCustom];
            _shuaxinBt.frame=CGRectMake(0, 0, 90,28);
            [_shuaxinBt setTitle:@"刷新试试>" forState:UIControlStateNormal];
            [_shuaxinBt setTitleColor:[UIColor colorWithHexString:@"4895ee"] forState:UIControlStateNormal];
            _shuaxinBt.layer.cornerRadius=4;
            _shuaxinBt.hidden=YES;
            _shuaxinBt.titleLabel.font=[UIFont systemFontOfSize:14];
            _shuaxinBt.layer.borderColor=[UIColor colorWithHexString:@"4895ee"].CGColor;
           _shuaxinBt.layer.borderWidth=1;
            [_emptyDataBackgroundView addSubview:_shuaxinBt];

        }
        self.emptyDataBackgroundView.hidden = NO;
    }
    return self;
}

- (void)setLogoImage:(NSString*)imageName cellHeight:(float)height
{
    UIImage* image = [UIImage imageNamed:imageName];
    CGSize imgSize = image.size;
    _logo.image = image;
    
    _emptyDataBackgroundView.height=height;
   
    _logo.size=CGSizeMake(imgSize.width, imgSize.height);
    _logo.center=CGPointMake(SCREEN_WIDTH/2, 100);
    _titleLabel.center=CGPointMake(SCREEN_WIDTH/2, 0);
    _titleLabel.top=_logo.bottom+20;
    _shuaxinBt.center=CGPointMake(SCREEN_WIDTH/2, 0);
    _shuaxinBt.top=_titleLabel.bottom+58;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}
-(void)layoutSubviews{
    
    [super layoutSubviews];
    
}
@end
